enum Unit {
  jin(label: '斤'),
  kg(label: '公斤'),
  fen(label: '份');

  final String label;

  const Unit({required this.label});

  static Unit nameOf(String unit) {
    return Unit.values
        .firstWhere((element) => element.name.toUpperCase() == unit);
  }
}
